package com.huirui.server.controller.mini.program;

import com.huirui.server.pojo.result.Result;
import com.huirui.server.pojo.vo.ProductParameterVo;
import com.huirui.server.service.ProductParameterService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/parameter")
@Slf4j
@Tag(name = "商品参数管理", description = "微信小程序商品参数相关")
public class ProductParameterController {
    @Resource
    private ProductParameterService parameterService;

    @GetMapping
    @Operation(summary = "根据商品Id获取商品参数信息")
    public Result<ProductParameterVo> getProductParameterInfoByProductId(@RequestParam("id") Long productId) {
        ProductParameterVo parameterVo = parameterService.getProductParameterInfoByProductId(productId);
        return Result.success(parameterVo);
    }
}
